package com.itheima.多线程.基础;

public class MyRunnable implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + "...." + i);
        }
    }
}

class TestRunnable {
    public static void main(String[] args) {
        MyRunnable my = new MyRunnable();
        Thread th = new Thread(my, "线程");
        th.start();
    }
}